package se.jocke.nbrs.service.event;

import se.jocke.nbrs.model.RestService;

/**
 *
 * @author jocke
 */
public class RestRequestFailed {

    private Exception exception;

    private RestService restService;

    public RestRequestFailed(Exception exception, RestService restService) {
        this.exception = exception;
        this.restService = restService;
    }

    public Exception getException() {
        return exception;
    }

    public RestService getRestService() {
        return restService;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 37 * hash + (this.exception != null ? this.exception.hashCode() : 0);
        hash = 37 * hash + (this.restService != null ? this.restService.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final RestRequestFailed other = (RestRequestFailed) obj;
        if (this.exception != other.exception && (this.exception == null || !this.exception.equals(other.exception))) {
            return false;
        }
        if (this.restService != other.restService && (this.restService == null || !this.restService.equals(other.restService))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "RestRequestFailed{" + "exception=" + exception + ", restService=" + restService + '}';
    }

}
